package datastructures.queue;

/**
 * @author hck
 */
public class TestArrayQueue {
    public static void main(String[] param) {
        ArrayQueue<Integer> arrayQueue = new ArrayQueue<>(Integer.class, 5);

        arrayQueue.add(1);
        arrayQueue.add(2);
        arrayQueue.add(3);
        arrayQueue.add(4);
        System.out.println("origin array:");
        arrayQueue.print();
        System.out.println("------------------");

        System.out.println("pop data:");
        System.out.println(arrayQueue.pop());
        arrayQueue.print();
        System.out.println("------------------");

        arrayQueue.add(5);
        arrayQueue.add(6);
        arrayQueue.print();

        System.out.println(arrayQueue.pop());
        System.out.println(arrayQueue.pop());
        System.out.println(arrayQueue.pop());
        System.out.println(arrayQueue.pop());
        arrayQueue.print();
        arrayQueue.add(7);
        arrayQueue.add(8);
        arrayQueue.add(9);
        arrayQueue.add(10);
        arrayQueue.print();

        System.out.println(arrayQueue.pop());
        System.out.println(arrayQueue.pop());
        arrayQueue.print();
        arrayQueue.add(11);
        arrayQueue.add(12);
        arrayQueue.print();
    }
}
